﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RWLibrary.Logic.BooleanExpression
{
    public class Negation : UnaryExpression
    {
        public IBooleanExpression BooleanExpression { get; protected set; }
        public Negation(IBooleanExpression exp)
        {
            BooleanExpression = exp;
        }
        public override bool Test(State s)
        {
            return !BooleanExpression.Test(s);
        }

        public override string ToString()
        {
            return "(!" + BooleanExpression.ToString() + ")";
        }
    }
}
